package cn.whut.glab.service;

import java.sql.SQLException;
import java.util.List;

import cn.whut.glab.dao.TeacherDao;
import cn.whut.glab.domain.BD_Teacher;
import cn.whut.glab.domain.EasyUIPager;

public class TeacherService {

	TeacherDao dao=new TeacherDao();
	public EasyUIPager getTeachList(int rows, int page ,BD_Teacher teacher) throws SQLException {
		List<BD_Teacher> list= dao.getTeacherList(rows,page,teacher);
		int total=dao.getTeacherCount();
		EasyUIPager pager=new EasyUIPager();
		pager.setRows(list);
		pager.setTotal(total);
		return pager;
	}
	
	public void deleteTeacher(String Id) throws SQLException{
		dao.deleteTeacher(Id);
	}

	public void addTeacher(BD_Teacher teacher) throws SQLException{
		dao.addTeacher(teacher);
	}
	
	public void editTeacher(BD_Teacher teacher, String Id) throws SQLException{
		dao.editTeacher(teacher, Id);
	}

}
